<% breadcrumb.add @model.description, edit_backend_email_template_path(@model) %>
<% breadcrumb.add t('b.edit') %>
<%= render 'backend/breadcrumbs' %>

<%= render 'backend/email_templates/tabs', active: params[:translation_locale].to_sym %>

<%= simple_form_for([:backend, @translation], url: edit_translation_backend_email_template_path) do |f| %>

  <% if @model.vars.present? %>
    <div class="row">
      <div class="col-md-12">
        <div class="card">
          <div class="card-header">
            <%= t 'b.variables' %>
          </div>

          <div class="card-block">
            <%= @model.vars.to_s.html_safe %>
          </div>
        </div>
      </div>
    </div>
  <% end %>

  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header">
          <%= t 'b.content' %>
        </div>

        <div class="card-block">
          <div class="row">
            <div class="col-md-6">
              <%= f.input :subject, as: :string %>
            </div>
          </div>

          <div class="row">
            <div class="col-md-12">
              <%= f.input :html_content, as: :ckeditor %>
              <%= f.input :plain_content, as: :text, input_html: { rows: 10 } %>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <%= render 'backend/form_actions', cancel_url: backend_email_templates_path %>
<% end %>
